#ifndef __BSP_AP3216C_H__
#define __BSP_AP3216C_H__

#include "imx6u.h"

#define AP3216C_SYSTEMCFG				0x00
#define AP3216C_INTERRUPTSTATS			0x01
#define AP3216C_INTCLEANMANNER			0x02
#define AP3216C_IRDATALOW				0x0A
#define AP3216C_IRDATAHIGH				0x0B
#define AP3216C_ALSDATALOW				0x0C
#define AP3216C_ALSDATAHIGH				0x0D
#define AP3216C_PSDATALOW				0x0E
#define AP3216C_PSDATAHIGH				0x0F

#define AP3216C_I2C_ADDR				0x1E


#define AP3216C_SYSTEMCFG_POWERDOWN		0x0
#define AP3216C_SYSTEMCFG_ALS			0x1
#define AP3216C_SYSTEMCFG_PS_IR			0x2
#define AP3216C_SYSTEMCFG_ALS_PS_IR		0x3
#define AP3216C_SYSTEMCFG_SW_RESET		0x4
#define AP3216C_SYSTEMCFG_ALS_ONCE		0x5
#define AP3216C_SYSTEMCFG_PS_IR_ONCE	0x6
#define AP3216C_SYSTEMCFG_ALS_PS_IR_ONCE	0x7


void i2c_ap3216c_init(void);
unsigned char ap3216c_writeonebyte(unsigned char addr, unsigned char reg, unsigned char data);
unsigned char ap3216c_readonebyte(unsigned char addr, unsigned char reg);
void ap3216c_readdata(unsigned short *ir, unsigned short *ps,
	unsigned short *als);
#endif 